<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../raty-2.5.2/demo/css/application.css"/>
		<link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">
		<link rel="stylesheet" type="text/css" href="../style/fjol_style.css"/>
		<link rel="stylesheet" type="text/css" href="../style/xol_style.css"/>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">服务评价</h1>
		</header>
		<div class="mui-content">
		    <div class="mui-scroll-wrapper" style="top: 50px;">
		        <div class="mui-scroll">
		            <!--这里放置真实显示的DOM内容-->
		            <div class="mb10">
		            	<p class="p10">经纪人</p>
		            	<ul class="mui-table-view">
	            	        <li class="">
	            	            <img src="../images/icon_customer_service.png" width="60" height="60" style="vertical-align: middle;" />
	            	            <span>李经纪</span>
	            	        </li>
	            	    </ul>
		            </div>
		            <div class="mb10">
		            	<p class="p10">星级评分</p>
		            	<ul class="mui-table-view">
	            	        <li class="p10 pt10 pb10" id="evaluateScore">
	            	           	<div class="demo">
						
						            <div id="half-demo"></div>
						
						        </div>
	            	        </li>
	            	    </ul>
		            </div>
		            <div class="mb10">
		            	<p class="p10">服务评价</p>
		            	<textarea style="border: none;" id="content" name="" rows="10" cols="" placeholder="请留下您对经纪人的宝贵意见或建议"></textarea>
		            </div>
		            
		            <div class="p10">
		            	<button type="button" class="mui-btn green05b160 mui-btn-block" onclick="submitEvaluate();">提交</button>
		            </div>
		        </div>
		    </div>
		    
		</div>
		<script src="../js/mui.min.js"></script>
		<script src="../js/common.util.js"></script>
		<script src="../js/network.js"></script>
		<script src='../js/md5.js'></script>
		<script src="../js/jquery-2.1.0.js"></script>
		<script src="../raty-2.5.2/lib/jquery.raty.min.js"></script>
		
		<script type="text/javascript">
			$('#half-demo').raty({ half: true });		//星级评价
			
			mui.init();
			var reserveId,		//预约id
				kind,			//房源类型 (1新房, 2二手房, 3租房)
				salemanId,		//销售人员id
				clientId,		//客户id
				score,			//星级(分数)
				content;		//评价正文
				
			mui.plusReady(function(){
				var wv = plus.webview.currentWebview();
				reserveId = wv.reserveId;
				kind = wv.kind;
				salemanId = wv.salemanId;
				clientId = wv.clientId;
			})
			function submitEvaluate(){
				var content = document.querySelector('#content').value;
				var score = document.querySelector('#half-demo input[name="score"]').value;
//				console.log(score+','+reserveId+','+kind+','+salemanId+','+clientId);
				if(!score){
					mui.toast('请评分');
					return false;
				}
				var param = [{
					key:'reserveId',
					value:reserveId
				},{
					key:'kind',
					value:kind
				},{
					key:'salemanId',
					value:salemanId
				},{
					key:'clientId',
					value:clientId
				},{
					key:'score',
					value:score
				},{
					key:'content',
					value:content
				}];
				fjNetwork.post('fjzx/client/add-saleman-comment.json',param,function(data){
					mui.toast(data.msg);
					mui.back();
					plus.webview.getWebviewById('xol_reservation_sub').reload(true);
				},function(msg){
					mui.toast(msg);
				});
			}
		</script>
	</body>

</html>